<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <a href="javascript:" @click="auth()">关闭第二个页面</a>
    <router-link to="/HelloWorld2">这是去第二个页面的入口</router-link>
    <router-link to="/HelloWorld3">这是去第三个页面的入口</router-link>
    <router-link to="/HelloWorld333">这是去404页面的入口</router-link>
  </div>
</template>

<script>
  import HelloWorld3 from '@/components/HelloWorld3'

  export default {
    data() {
      return {
        msg: 'Welcome to Your Vue.js App'
      }
    },
    mounted() {
      console.info(this.$router)
    },
    methods: {
      auth() {
        console.info(this.$router)
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  h1, h2 {
    font-weight: normal;
  }

  ul {
    list-style-type: none;
    padding: 0;
  }

  li {
    display: inline-block;
    margin: 0 10px;
  }

  a {
    color: #42b983;
  }
</style>
